Hi guys, this lecture is about:
If you have never used Github before that’s okay. Basically its just a website people use to share code. What you need to do is download the guide (which should be less than 10MB) from Github. You should find a big green button somewhere in the middle-right of the screen. The picture below should help you locate it.
Talking of pictures, if you happen to be reading the main guide and an image fails to load you should be able to find it in the graphics folder.
The official instructions for installing the notebook can be found here: http://jupyter.org/install.html
This should take you through the process. If you know what 'PIP' is installing the Notebook can be as simple as typing (at the command line):
pip3 install jupyter
I would go into more detail, but I run Linux as an operating system and so I can't really help windows users (and if Linux users need more help than this they probably shouldn't be running Linux!)
An official introduction to Juypter can be found here: https://jupyter.readthedocs.io/en/latest/running.html#running
To get started, go to the command line and type:
jupyter notebook
This should start a session in your browser. Simply find the directory where you saved my guide and open up the lectures. And voilà! You are ready to rock and roll.
Now, Jupyter notebook has two basic modes, and 'editing' mode and a 'reading' mode. So, if you are in 'editing mode' right now you should see something like this:
Whereas, if you are currently in reading mode you should see something more like this:
If you are currently in reading mode then you should be able to double-click on the 'cell' (the text box) and that should take you to editing mode. Conversely, if you are in editing mode and you want to read simply go to the top menu, click 'cell' and select 'run all'. Or alternately, you can just hit the play button which I've highlighted yellow in the picture below:
In addition to the Notebook having two basic modes (reading, editing), Notebook also has two types of cells; text cells that support markdown and are designed to display, yes you've guess it, text. Code cells meanwhile allow us to run Python code.
Below this text cell I have a code cell, it has the simple sum 7 + 7 in it. If we run it, notice the number 14 is printed directly below the cell.
In [2]:
7 + 7
Out[2]:
So, you should see something like this:
Okay cool, so now what I want you to do is go into editing mode (just click on the box) and delete the number 7 and type 3 instead. Now try running it. The number 10 should be seen directly below cell.
Congratulations! You have just learnt how to add numbers together in Python! As you work through my guide I would highly recommend tinkering with the code I provide, by changing different pieces and checking what happens is a really nice way to learn the material. In my mind the ability to play with code on the fly makes this medium much better than something like an ebook or a 'pdf' file.
For your homework, I want you to have a 'play' with the code cell below. Try different numbers and a few different symbols ( +-*/ ) and see what happens. We will learn what all this stuff does in the numbers lecture, but for now the main purpose of this exercise it getting you familiar with editing and running code within Jupyter notebook.
In [ ]: